Problems with tag O(n * rlogn)